package com.bruce.demo1.principles.demo3.dlp.demo2;


/**
 * @PROJECT_NAME design_patterns
 * @DESCRIPTION 测试类
 * @AUTHOR CNBruceLee
 * @DATE 2021/6/21 7:06
 */
public class Test {
    public static void main(String[] args) {
        //创建计算机所需的组件
        HardDisk hardDisk = new XiJieHardDisk();
        Memory memory = new KingStonMemory();
        Cpu cpu = new InterCpu();

        //组装计算机
        Computer computer = new Computer();
        computer.setCpu(cpu);
        computer.setHardDisk(hardDisk);
        computer.setMemory(memory);

        //运行
        computer.run();
    }
}
